<template>
    <view class="page" :style="themeColor">

 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout"   >
            <view   class='flex flex-wrap align-center justify-center codeLogin_fd0_0'     >
        <image class='codeLogin_fd0_0_c0' mode="aspectFit"  :src='STATIC_URL+"2.png"'></image>
</view>
    <view   class='flex flex-wrap align-center codeLogin_fd0_1'     >
        <image class='codeLogin_fd0_1_c0' mode="aspectFit"  :src='STATIC_URL+"3.png"'></image>
<input class='flex-sub codeLogin_fd0_1_c1'  type="number" placeholder="请输入手机号" confirm-type="done" :maxlength="11" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"  v-model="mobile" />
</view>
    <view   class='flex flex-wrap align-center codeLogin_fd0_2'     >
        <image class='codeLogin_fd0_1_c0' mode="aspectFit"  :src='STATIC_URL+"5.png"'></image>
<input class='flex-sub codeLogin_fd0_1_c1'  type="number" placeholder="请输入验证码" confirm-type="done" :maxlength="4" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"  v-model="code" />
<benben-send-verification-code class='flex  codeLogin_fd0_2_c2' after-text='后重新获取' before-text='获取验证码' type='3'  :phone="mobile"></benben-send-verification-code>
</view>
<text class='self-end codeLogin_fd0_3'    @tap.stop="handleJumpDiy" data-type="redirectTo" :data-url="`/pages/tabBar/login/login`" >密码登录</text>
    <view   class='flex align-center justify-center'     >
        <button class='codeLogin_fd0_4_c0' @tap.stop="goLoginFunc()"  >登录</button>
</view>
    <view   class='flex flex-wrap align-center justify-center codeLogin_fd0_5'     >
        <text class='codeLogin_fd0_5_c0'    @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dlzc/register/register`" >注册账号 </text>
    <view   class='flex flex-wrap align-center codeLogin_fd0_5_c1'     >
        </view>
<text class='codeLogin_fd0_5_c0'    @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dlzc/forgetPwd/forgetPwd`" >忘记密码</text>
</view>
</view>
        

    <view class="flex flex-direction align-center benben-position-layout flex codeLogin_flex_1"    >
            <view   class='flex flex-wrap align-center'     >
            <view   class='flex flex-wrap align-center codeLogin_fd1_0_c0'     >
        </view>
<text class='codeLogin_fd1_0_c1' >快捷登录</text>
    <view   class='flex flex-wrap align-center codeLogin_fd1_0_c0'     >
        </view>
</view>
<image class='codeLogin_fd1_1' :src='STATIC_URL+"73.png"' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dlzc/bandMobile/bandMobile`" ></image>

        </view>
<view :style="{height: '300rpx'}"  ></view>
    
    
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    export default {
        components:{},
        
        
        data(){
			return {"code":"","mobile":"","userInfo":{"user_token":"","id":"","account":"","avatar":"","real_name":"","nickname":"","email":"","gender":"","mobile":"","birthday":"","client_id":"","phone":""},"check":false};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //验证码登录
                async goLoginFunc(){
                                if(this.check===false){
                 this.$message.info('请阅读并同意协议和政策');
                 return false;
            }
            if(!validate(this.mobile,'require')){
                 this.$message.info('手机号不能为空');
                 return false;
            }
            if(!validate(this.mobile,'phone')){
                 this.$message.info('请输入正确的手机号');
                 return false;
            }
            if(!validate(this.code,'require')){
                 this.$message.info('验证码不能为空');
                 return false;
            }
            if(!validate(this.code,'captcha')){
                 this.$message.info('验证码错误');
                 return false;
            }
    //请求方法
    //数据验证
    
  let datauserInfo = await this.$api.post(global.apiUrls.post5c78dca45ebc1, {
    mobile:this.mobile,code:this.code,type:'3'
  });
  
  if (datauserInfo.data.code != 1) {
    this.$message.info(datauserInfo.data.msg);
    return
  } 
  let infouserInfo = datauserInfo.data;
  this.userInfo = infouserInfo.data.userinfo
                this.$store.commit('saveToken', this.userInfo.user_token)
                this.$store.commit('updateUserInfo', this.userInfo)
                this.toHomeDiy();
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:var(--benbenbgColor1);background-size: 100% auto !important;
        }
    .codeLogin_fd0_5_c1{
        background:rgba(191, 191, 191, 1);width:1rpx;height:24rpx;background-size:100% auto !important;margin:0rpx 32rpx 0rpx 32rpx;
    }
    .codeLogin_fd0_5_c0{
        font-size:28rpx;font-weight:400;color:#333333;line-height:40rpx;
    }
    .codeLogin_fd0_5{
        line-height:40rpx;margin:40rpx 0rpx 0rpx 0rpx;
    }
    .codeLogin_fd0_4_c0{
        background:rgba(205, 150, 45, 1);font-size:32rpx;color:#fff;height:88rpx;line-height:88rpx;font-weight:500;width:638rpx;border-radius:44rpx 44rpx 44rpx 44rpx;
    }
    .codeLogin_fd0_3{
        line-height:40rpx;font-size:28rpx;font-weight:400;color:#333333;margin:32rpx 55rpx 48rpx 0rpx;
    }
    .codeLogin_fd0_2_c2{
        font-size:28rpx;font-weight:400;color:rgba(0, 91, 196, 1);
    }
    .codeLogin_fd0_2{
        border-bottom:1px solid #eee;padding:40rpx 0rpx 40rpx 0rpx;margin:0rpx 30rpx 0rpx 28rpx;
    }
    .codeLogin_fd0_1_c1{
        line-height:45rpx;font-size:32rpx;font-weight:400;color:#333;
    }
    .codeLogin_fd0_1_c0{
        width:34rpx;height:34rpx;margin:0rpx 28rpx 0rpx 0rpx;
    }
    .codeLogin_fd0_1{
        border-bottom:1px solid #eee;padding:40rpx 0rpx 40rpx 0rpx;margin:-191rpx 30rpx 0rpx 28rpx;
    }
    .codeLogin_fd0_0_c0{
        width:295rpx;height:82rpx;border-radius:20rpx 20rpx 20rpx 20rpx;
    }
    .codeLogin_fd0_0{
        background:url(/static/images/1.png) no-repeat ,transparent;height:600rpx;background-size:100% auto !important;
    }
    .codeLogin_flex_1{
        background:#fff;width:750rpx;height:300rpx;overflow:hidden;z-index:10;bottom:calc(0rpx + var(--window-bottom));background-size:100% auto !important;
    }
    .codeLogin_fd1_1{
        width:80rpx;height:80rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:40rpx 0rpx 0rpx 0rpx;
    }
    .codeLogin_fd1_0_c1{
        line-height:32rpx;font-size:26rpx;font-weight:400;color:#999999;padding:0rpx 7rpx 0rpx 7rpx;
    }
    .codeLogin_fd1_0_c0{
        background:rgba(238, 238, 238, 1);background-size:100% auto !important;height:1rpx;width:157rpx;
    }
</style>